<?php
header("content-type:text/html;charset=utf-8");
include "../../public/config/config.php";
include "../../public/include/funcs.php";
include "../../public/include/money_fx.class.php";
$obj=new money($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd,$cfg_dbname,$cfg_dbchar);
$link=conn($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd,$cfg_dbname,$cfg_dbchar);

$id = $_REQUEST['id'] ? $_REQUEST['id'] : 60006;
$uarr=select($link, "user","id=$id");
//$uarr[0]['self_xf']=$obj->self_xf($id);
//$uarr[0]['all_xf']=$obj->all_xf($id);
//$title_name=$uarr[0]['tname']." -- 业绩详情";

//自己消费
$self_xf = $obj->self_xf($id);

$tic_arr=select($link, 'tic');
foreach($tic_arr as $v){
	$tic[$v['id']] = $v;
}


$arr_id=$obj->arr_id($id);
$arr_fx_money=$obj->arr_fx_money($arr_id);

//一级消费
$xf1 = $arr_fx_money[1];
//二级消费
$xf2 = $arr_fx_money[2];

//自己消费提成
$pv1 = $self_xf * $tic[1]['tic_xf'] / 100;
//一级消费提成
$pv2 = $xf1 * $tic[1]['tic_yi'] / 100;
//二级消费提成
$pv3 = $xf2 * $tic[1]['tic_er'] / 100;
//最后佣金
$pv = $pv1 + $pv2 + $pv3;

//echo $pv1;
//echo "<br>";
//echo $pv2;
//echo "<br>";
//echo $pv3;
//echo "<br>";
echo $pv;

//echo "<pre>";
//print_r($tic);
//print_r($uarr);
//print_r($arr_id);
//print_r($arr_fx_money);
//echo "</pre>";













?>